
# 环境变量
PORT=$1
REDIS_HOME=/opt/module/redis/cluster
for num in {1..6}; do
REDIS_DATA=$REDIS_HOME/r$num/data
REDIS_CONF=$REDIS_HOME/r$num/redis.conf
REDIS_LOG=$REDIS_HOME/r$num/redis.log
# 建目录
mkdir -p $REDIS_DATA
sudo cat >$REDIS_CONF<<EOF
bind 0.0.0.0
appendonly yes
cluster-enabled yes
cluster-config-file nodes.conf
cluster-node-timeout 15000
EOF
touch $REDIS_LOG
chmod 666 $REDIS_CONF $REDIS_LOG
done
exit 